package com.amarsoft.are.log.impl.simple;

import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

public abstract class Formatter
{
  public abstract String format(LogRecord paramLogRecord);

  public String getHead(SimpleHandler paramSimpleHandler)
  {
    return "";
  }

  public String getTail(SimpleHandler paramSimpleHandler)
  {
    return "";
  }

  public synchronized String formatMessage(LogRecord paramLogRecord)
  {
    String str = paramLogRecord.getMessage();
    ResourceBundle localResourceBundle = paramLogRecord.getResourceBundle();
    if (localResourceBundle != null)
      try
      {
        str = localResourceBundle.getString(paramLogRecord.getMessage());
      }
      catch (MissingResourceException localMissingResourceException)
      {
        str = paramLogRecord.getMessage();
      }
    try
    {
      Object[] arrayOfObject = paramLogRecord.getParameters();
      if ((arrayOfObject == null) || (arrayOfObject.length == 0))
        return str;
      if (str.indexOf("{0") >= 0)
        return MessageFormat.format(str, arrayOfObject);
      return str;
    }
    catch (Exception localException)
    {
    }
    return str;
  }
}

/* Location:           D:\办公软件\反编译工具\jar\are-1.0b96.jar
 * Qualified Name:     com.amarsoft.are.log.impl.simple.Formatter
 * JD-Core Version:    0.5.3
 */